package com.zxy;

public class demo07 {
    public static void main(String[] args) {
        String str1 = "cheng@xuyuan@heima";
        String str2 = "co-m-itcast-cn";
        String[] strs1 = str1.split("@");//分割字符串
        String[] strs2 = str2.split("-");
        System.out.println("strs1[1]结果是：" + strs1[1]);
        System.out.println("strs2[1]结果是：" + strs2[1]);
    }
}
